<template>
    <div :id='"qrcode" + caseId'>111</div>
</template>

<script>
import { qrcanvas } from 'qrcanvas';
export default {
  mounted () {
    let that = this;
    var canvas = qrcanvas({
      data: this.data,
      size: this.width
    });
    document.getElementById('qrcode' + that.caseId).innerHTML = '';
    document.getElementById('qrcode' + that.caseId).appendChild(canvas);
  },
  data () {
    return {
      caseId: parseInt(Math.random() * 100000)
    };
  },
  props: {
    // 二维码内容
    data: String,
    // 二维码大小
    width: Number
  }
};
</script>

<style lang='stylus' scoped>

</style>
